package weiyao.xinxidasai.pojo;


import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.validation.constraints.Pattern;

@NoArgsConstructor
@AllArgsConstructor
public class Users {
    private Long userId;

    public Integer getSecurityLevel() {
        return securityLevel;
    }

    public void setSecurityLevel(Integer securityLevel) {
        this.securityLevel = securityLevel;
    }

    private Integer securityLevel;
    @Pattern(regexp = "^[a-zA-Z0-9]{8,20}$",
            message = "用户名必须为8-10位字母数字组合")
    private String username;

    @Pattern(regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d).{10,}$",
            message = "密码必须至少10位，包含大小写字母和数字")
    private String password;
   private String secretKey;

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public @Pattern(regexp = "^[a-zA-Z0-9]{8,20}$",
            message = "用户名必须为8-20位字母数字组合") String getUsername() {
        return username;
    }

    public void setUsername(@Pattern(regexp = "^[a-zA-Z0-9]{8,20}$",
            message = "用户名必须为8-20位字母数字组合") String username) {
        this.username = username;
    }

    public @Pattern(regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d).{10,}$",
            message = "密码必须至少10位，包含大小写字母和数字") String getPassword() {
        return password;
    }

    public void setPassword(@Pattern(regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d).{10,}$",
            message = "密码必须至少10位，包含大小写字母和数字") String password) {
        this.password = password;
    }

    public String getSecretKey() {
        return secretKey;
    }

    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }
}